package com.huawei.appgallery.appcomment.ui.usercomment;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import o.azb;
import o.bcg.d;
import o.bcg.e;
import o.cdr;
import o.cgz;
import o.chy;
import o.cih;
import o.ckt;

public class UserCommentNode extends cdr {

    public static class c implements OnClickListener {
        private final chy ˋ;
        private final cgz ˎ;
        private final int ॱ;

        public c(chy o_chy, cgz o_cgz, int i) {
            this.ˋ = o_chy;
            this.ˎ = o_cgz;
            this.ॱ = i;
        }

        public void onClick(View view) {
            if (this.ˋ != null && this.ˎ != null) {
                this.ˋ.ˏ(this.ॱ, this.ˎ);
            }
        }
    }

    public UserCommentNode(Context context) {
        super(context, 1);
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        View inflate = LayoutInflater.from(this.ॱ).inflate(d.ᐝॱ, null);
        azb.ˏ(inflate);
        cih userCommentInfoCard = new UserCommentInfoCard(this.ॱ);
        userCommentInfoCard.ˏ(inflate);
        ˊ(userCommentInfoCard);
        viewGroup.addView(inflate, new LayoutParams(-1, -2));
        return true;
    }

    public void ˋ(chy o_chy) {
        for (int i = 0; i < ˊॱ(); i++) {
            cgz ˊ = ˊ(i);
            if (ˊ instanceof UserCommentInfoCard) {
                View ˉ = ˊ.ˉ();
                if (ˉ != null) {
                    ˉ = ˉ.findViewById(e.ˋᐝ);
                    if (ˉ != null) {
                        ˉ.setOnClickListener(new ckt(new c(o_chy, ˊ, 0)));
                    }
                }
                UserCommentInfoCard userCommentInfoCard = (UserCommentInfoCard) ˊ;
                userCommentInfoCard.ˊ().setOnClickListener(new ckt(new c(o_chy, ˊ, 1003)));
                userCommentInfoCard.ˋ().setOnClickListener(new ckt(new c(o_chy, ˊ, 1003)));
                userCommentInfoCard.ॱ().setOnClickListener(new ckt(new c(o_chy, ˊ, 1003)));
                userCommentInfoCard.ˏ().setOnClickListener(new c(o_chy, ˊ, 1002));
                userCommentInfoCard.ˎ().setOnClickListener(new c(o_chy, ˊ, 1008));
                ˊ(userCommentInfoCard, o_chy);
            }
        }
    }

    public void ˊ(UserCommentInfoCard userCommentInfoCard, chy o_chy) {
        userCommentInfoCard.ᐝ().setOnClickListener(new c(o_chy, userCommentInfoCard, 1004));
    }
}
